package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-04-17.
 * <br>
 * 添加通知的请求参数。
 */
public class AddNoticeParam {
    /**
     * 通知标题
     */
    @NotBlank(message = "通知标题不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_500, message = "通知标题的长度在1至500个字之间")
    private String noticeName;
    /**
     * 通知内容
     */
    @NotBlank(message = "通知内容不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_2000, message = "通知内容的长度在1至2000个字之间")
    private String noticeContent;
    /**
     * 通知级别
     */
    @NotBlank(message = "通知级别不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_1, message = "通知级别的长度为一个字符")
    @Pattern(regexp = Constants.NUMBER_RE, message = ("通知级别" + Constants.NUMBER_RE_MSG))
    private String noticeLevel;
    /**
     * 通知附件的名称，多个名称用“|”分隔
     */
    @Pattern(regexp = Constants.STR_SPLIT_EMPTY_RE, message = "通知附件的名称格式不正确")
    private String noticeFileNames;
    /**
     * 通知附件的路径，多个路径用“|”分隔
     */
    @Pattern(regexp = Constants.STR_SPLIT_EMPTY_RE, message = "通知附件的路径格式不正确")
    private String noticeFilePaths;

    /**
     * 默认构造器。
     */
    public AddNoticeParam() {
        super();
    }

    public String getNoticeName() {
        return noticeName;
    }

    public void setNoticeName(String noticeName) {
        this.noticeName = noticeName;
    }

    public String getNoticeContent() {
        return noticeContent;
    }

    public void setNoticeContent(String noticeContent) {
        this.noticeContent = noticeContent;
    }

    public String getNoticeLevel() {
        return noticeLevel;
    }

    public void setNoticeLevel(String noticeLevel) {
        this.noticeLevel = noticeLevel;
    }

    public String getNoticeFileNames() {
        return noticeFileNames;
    }

    public void setNoticeFileNames(String noticeFileNames) {
        this.noticeFileNames = noticeFileNames;
    }

    public String getNoticeFilePaths() {
        return noticeFilePaths;
    }

    public void setNoticeFilePaths(String noticeFilePaths) {
        this.noticeFilePaths = noticeFilePaths;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("AddNoticeParam{");
        sb.append("noticeName='").append(noticeName).append('\'');
        sb.append(", noticeContent='").append(noticeContent).append('\'');
        sb.append(", noticeLevel='").append(noticeLevel).append('\'');
        sb.append(", noticeFileNames='").append(noticeFileNames).append('\'');
        sb.append(", noticeFilePaths='").append(noticeFilePaths).append('\'');
        sb.append('}');
        return sb.toString();
    }
}